//导航条点击跳转且被激活状态
var navbarUl = document.getElementsByClassName('navbar-ul')[0];
var navbarUlLi = navbarUl.children;

navbarUl.onclick = function (e) {
    // console.log(e.target);
}

//地址栏(根据地址栏的哈希值和导航栏的href来判断是在那一页)
var locationName = document.location.href.split('/')[3];
// console.log(locationName);

for (var i = 0; i < navbarUlLi.length; i++) {
    if (navbarUlLi[i].children[0].getAttribute("href").includes(locationName)) {
        // console.log(navbarUlLi[i].children[0].getAttribute("href"));
        // console.log(i);
        navbarUlLi[i].classList.add("open");
    }
}

